package com.ruoyi.web.controller.fee;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.web.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testMqController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("Mq/{name}")
    @Anonymous
    public String test(@PathVariable String name){
        rabbitTemplate.convertAndSend(RabbitMQConfig.HS_CALLING, "hs.test", name);
        return "创建成功";
    }
}
